package szcg.main.service.api;

import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
import jakarta.servlet.http.HttpServletRequest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import szcg.framework.library.base.PostController;
import szcg.framework.library.entity.UserBean;
import szcg.main.service.service.CaptchaService;
import szcg.main.service.service.UserService;

import java.util.HashMap;


@RestController
@RequestMapping(value = "/main", produces = {"application/json;charset=UTF-8"})
public class MAIN_000_000_002 extends PostController {
    private static final Logger logger = LoggerFactory.getLogger(MAIN_000_000_002.class);

    private final CaptchaService captchaService;

    public MAIN_000_000_002(CaptchaService captchaService) {
        this.captchaService = captchaService;
    }

    //验证码接口
    @PostMapping(value = "/000_000_002")
    public String doPost(HttpServletRequest request) {
        return handleRequest(request);
    }

    @Override
    protected String postRequest(HashMap<String, String> param) {
        HashMap<String, String> captcha = captchaService.getCaptcha();
        return generateSucceed(captcha);
    }
}
